package com.szholly.pro.watergas_server.ps.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.szholly.pro.watergas_server.ps.schedule.CalcAmount;
import com.szholly.pro.watergas_server.ps.schedule.DataAlarm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.szholly.pro.watergas_server.common.web.BaseController;
import com.szholly.pro.watergas_server.ps.service.RemoteService;

@Controller
@RequestMapping("/schedule/*")
public class ScheduleController extends BaseController { 
	
	@Autowired
	RemoteService remoteService;
	
	protected Logger logger = LoggerFactory.getLogger(getClass());
	
	/**
	 * 执行报警数据生成
	 * gislin
	 * 2016年2月1日
	 * @param resq
	 * @param res
	 * @throws Exception
	 */
	@RequestMapping(value = "/alarm")
	public void alarm(HttpServletRequest resq, HttpServletResponse res) throws Exception {
		DataAlarm alarm = new DataAlarm();
		alarm.execute();
		outString("success");
	}
	
	/**
	 * 执行报警数据生成
	 * gislin
	 * 2016年2月1日
	 * @param resq
	 * @param res
	 * @throws Exception
	 */
	@RequestMapping(value = "/amount")
	public void amount(HttpServletRequest resq, HttpServletResponse res) throws Exception {
		CalcAmount amount = new CalcAmount();
		amount.execute();
		outString("success");
	}
}
